
//电子琴
#include "pitches.h"

const int fengMingPin = 7;
const int but1Pin = 8;
const int but2Pin = 9;
const int but3Pin = 10;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(fengMingPin, INPUT);
  for (int i = 8; i <= 10; i++) {
    pinMode(i, INPUT);
  }
}

void loop() {
  // put your main code here, to run repeatedly:
  if (digitalRead(but1Pin) == HIGH) {
    tone(fengMingPin, NOTE_D1, 100);
    Serial.println("1");
  }
  if (digitalRead(but2Pin) == HIGH) {
    tone(fengMingPin, NOTE_D3, 100);
    Serial.println("2");
  }
  if (digitalRead(but3Pin) == HIGH) {
    tone(fengMingPin, NOTE_D5, 100);
    Serial.println("3");
  }
  delay(130);
}
